//
//  HWNetWorkManager.h
//  嗨文
//
//  Created by 响当当 on 2019/1/8.
//  Copyright © 2019年 dongzheng. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef enum IMGTYPE
{
    IMGTYPE_PNG = 0,
    IMGTYPE_JPG = 1
} IMGTYPE;


typedef void(^RequsetSuccess)(id responseObject);
typedef void(^RequsetFailure)(NSError *error);

#define NetWorkingManager [HWNetWorkManager netWorkManager]

@interface HWNetWorkManager : NSObject
/**
 *   httpRequest
 */
+ (HWNetWorkManager *)netWorkManager;
/**
 *   监控网络状态
 */
- (void)monitorNetworking;
/**
 *   get
 */
- (void)getRequestUrl:(NSString *)urlStr
         withPramater:(NSDictionary *)pramater
               sucess:(RequsetSuccess)sucessCallBack
              failure:(RequsetFailure)failureCallBack;
/**
 *  post
 */
- (void)postRequestUrl:(NSString *)urlStr
          withPramater:(NSDictionary *)pramater
                sucess:(RequsetSuccess)sucessCallBack
               failure:(RequsetFailure)failureCallBack;
/**
 *  json
 */
- (void)postJsonRequest:(NSString *)urlStr
           withPramater:(NSDictionary *)pramater
                 sucess:(RequsetSuccess)sucessCallBack
                failure:(RequsetFailure)failureCallBack;

//上传头像
- (void)postImgWithUrl:(NSString *)urlStr
                   img:(NSArray *)imglist
               imgType:(IMGTYPE)imgtype
          withPramater:(NSDictionary *)pramater
                sucess:(RequsetSuccess)sucessCallBack
               failure:(RequsetFailure)failureCallBack;
@end

